A NAS (Network Attached Storage) device is provided for enabling file system sharing that can be accessed via an NFS (Network File System) protocol or a CIFS (Common Internet File System) protocol from a plurality of computers via a network. One of the means for protecting data saved in the NAS device is a CoW (Copy on Write) type snapshot (hereinafter referred to as “CoW snapshot”). According to the CoW snapshot, when a write request to the file system is received, the block data of the write destination is saved to a volume (hereinafter referred to as “differential volume”) that differs from the volume constituting the file system (hereinafter referred to as “primary volume”), and the data of the write request is overwritten to the block data of the primary volume. In a CoW snapshot, a virtual volume composed by combining the block data saved to the differential volume and the block data not overwritten in the primary volume is provided as a snapshot file system. In a CoW snapshot, in order to constitute a virtual volume corresponding to the snapshot, identification information such as an address of the data blocks within the differential volume of the data blocks saved during the CoW processing is saved as management information for each snapshot generation.
Generally, in order to restore a file stored in a file system from a CoW snapshot, the file in the file system is overwritten by the file in the snapshot. Actually, the file in the snapshot is copied to overwrite the file in the file system being the target of the restore processing using a function (a command or the like) to copy files provided by the OS or the like of various computers (such as the NAS client) using the NAS device. According to this restore method, all the blocks constituting the restore target file will be overwritten. Therefore, even the data blocks of the primary volume not saved in the differential volume will also be overwritten by the data blocks in the primary volume, so that unnecessary CoW processing occurs. Further, since the differential volume is consumed uselessly, the process is inefficient.
Methods for efficiently restoring file systems and files from a CoW snapshot are taught in patent literatures 1 and 2. According to these patent literatures, Cow processing is performed in block units, and based on the identification information of saved data blocks taught in the aforementioned management information, the block data saved to the exterior via CoW processing are specified and overwritten to the file system, according to which the file system and the files are restored to the state of a specific snapshot generation. Thus, it becomes unnecessary to restore the whole file system or the whole file, so that efficient restore processing can be executed.